import request from "@/request/request.js";
// 封装 登录请求
export const getUsers = (params) =>
  request({
    method: "get",
    url: "/users",
    params,
  });
// 封装添加用户的方法
export const addUsers = (data) =>
  request({
    method: "POST",
    url: "/users",
    data,
  });

// 修改状态的请求
export const putStatus = (uid, type) => {
  return request({
    method: "put",
    // url: `users/${uid}/state/${type}`,
    url: `users/${uid}/state/${type}`
  });
};
// 编辑数据的请求方法
export  const editUsers = (data)=>request({
    method:"put",
    url:"/users/" + data.id,
    data 
})
// 封装删除用户的请求
export  const delUsers = (id)=>request({
    method:"delete",
    url:"/users/"+id
  })
// 封装 请求角色列表部分
export const getRoles = ()=>request({
  method:"get",
  url:"/roles"
})